package com.empire.module.member.controller.admin.relationship;

import com.empire.framework.common.pojo.CommonResult;
import com.empire.module.member.controller.admin.relationship.vo.GraphDataVO;
import com.empire.module.member.service.relationship.GraphService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;

import static com.empire.framework.common.pojo.CommonResult.success;

@RestController
@RequestMapping("/member/graph")
public class GraphController {

    @Resource
    private GraphService graphService;

    /**
     * 查询人员关系图
     * @param id 人员ID
     * @return 关系数据
     */
    @GetMapping("/data")
    public CommonResult<GraphDataVO> getGraphData(@RequestParam(name = "id") Integer id) {
        return success(graphService.getGraphData(id));
    }
}
